import Layout from '@/layout'

const frontRouter = {
  path: '/front',
  name: 'Front',
  component: Layout,
  meta: {
    title: '前置配置',
    icon: 'front'
  },
  children: [
    {
      path: '/front/communication',
      name: 'Communication',
      // component: () => import('@/views/front/Communication'),
      component: resolve => require.ensure([], () => resolve(require('@/views/front/Communication')), 'front'),
      meta: {
        title: '数据通讯'
      }
    },
    {
      path: '/front/template',
      name: 'Template',
      // component: () => import('@/views/front/Template'),
      component: resolve => require.ensure([], () => resolve(require('@/views/front/Template')), 'front'),
      meta: {
        title: '设备模版'
      }
    },
    {
      path: '/template/:id/dataarea',
      hidden: true,
      name: 'Dataarea',
      // component: () => import('@/views/front/DataArea'),
      component: resolve => require.ensure([], () => resolve(require('@/views/front/DataArea')), 'front'),
      meta: {
        title: '数据区',
        noCache: true,
      }
    },
    {
      path: '/dataarea/:id/data',
      name: 'DataList',
      hidden: true,
      // component: () => import('@/views/front/DataListView'),
      component: resolve => require.ensure([], () => resolve(require('@/views/front/DataListView')), 'front'),
      meta: {
        title: '数据列表',
        noCache: true,
      }
    }
  ]
}

export default frontRouter;
